#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()
split = 0.5

fm1 = Frame(root, bg='red')
fm2 = Frame(root, bg='blue')

def incFm1(event):
    global split
    if split < 1:
        split += 0.1
    fm1.place(rely=0, relheight=split, relwidth=1)
    fm2.place(rely=split, relheight=1-split, relwidth=1)

def incFm2(event):
    global split
    if split > 0:
        split -= 0.1
    fm1.place(rely=0, relheight=split, relwidth=1)
    fm2.place(rely=split, relheight=1-split, relwidth=1)

fm1.place(rely=0, relheight=split, relwidth=1)
fm2.place(rely=split, relheight=1-split, relwidth=1)

fm1.bind('<Button-1>', incFm1)
fm2.bind('<Button-1>', incFm2)

root.mainloop()
